package com.websuites.proxy;

public class ConnectionParam 
{
	String redirectURL;
	private String host;
	private int port;
	private boolean keepAliveEnabled = true;
	private int keepAliveSecs = 20000;
	private int socketTimeout = 300000;
	private int maxPoolSize = 100;
	private int minPoolSize = 50;
	
	public String getRedirectURL() 
	{
		return redirectURL;
	}
	
	public void setRedirectURL(String redirectURL) 
	{
		this.redirectURL = redirectURL;
	}
	
	public String getHost() 
	{
		return host;
	}
	public void setHost(String host) 
	{
		this.host = host;
	}
	public int getPort() 
	{
		return port;
	}
	public void setPort(int port) 
	{
		this.port = port;
	}
	
	public int getSocketTimeout() 
	{
		return socketTimeout;
	}
	
	public void setSocketTimeout(int socketTimeout)
	{
		this.socketTimeout = socketTimeout;
	}
	
	public boolean isKeepAliveEnabled() 
	{
		return keepAliveEnabled;
	}
	
	public void setKeepAliveEnabled(boolean keepAliveEnabled) 
	{
		this.keepAliveEnabled = keepAliveEnabled;
	}
	
	public int getKeepAliveSecs() 
	{
		return keepAliveSecs;
	}
	public void setKeepAliveSecs(int keepAliveSecs) 
	{
		this.keepAliveSecs = keepAliveSecs;
	}
	public long getKeepAliveMilliSecs() 
	{
		return keepAliveSecs;
	}
	public int getMaxPoolSize() 
	{
		return maxPoolSize;
	}
	public void setMaxPoolSize(int maxPoolSize) 
	{
		this.maxPoolSize = maxPoolSize;
	}
	public int getMinPoolSize() 
	{
		return minPoolSize;
	}
	public void setMinPoolSize(int minPoolSize) 
	{
		this.minPoolSize = minPoolSize;
	}
	
    public String toString()
    {
        StringBuilder connectionParam = new StringBuilder(256);
        connectionParam.append("Proxy");
        connectionParam.append(":");
        connectionParam.append(this.host);
        connectionParam.append(":");
        connectionParam.append(this.port);
        connectionParam.append(", keep-alive-enabled='");
        connectionParam.append(keepAliveEnabled);
        connectionParam.append(", keep-alive='");
        connectionParam.append(keepAliveSecs);
        connectionParam.append("'secs");
        connectionParam.append(", socket-timeout='");
        connectionParam.append(socketTimeout);
        connectionParam.append("'secs");
        connectionParam.append(", max-pool-Size='");
        connectionParam.append(maxPoolSize);
        connectionParam.append(", min-pool-size='");
        connectionParam.append(minPoolSize);
        return connectionParam.toString();
    }
}
